package offlineFourSquare;

public class CommandProcessor implements ICommandProcessor
{
    private ICompressor compressor;
    private IClientStore clientStore;
    
    public CommandProcessor() 
    {
        
    }
    
    public CommandProcessor(ICompressor compressor) {
        this.compressor = compressor;
    }
    
    @Override
    public void ProcessCheckinCommand(
            int userID,
            double latitude,
            double longitude,
            String message) 
    {        
        System.out.println(
                String.format(
                        "userid: '%d', lat: '%f', long: '%f', msg: '%s'",
                        userID,
                        latitude,
                        longitude,
                        message));
     }
    
    private void ProcessCheckinCommandV2(
            int userID,
            double latitude,
            double longitude,
            String message)
    {
        this.clientStore.SaveCheckin(null);
        
        // List<String> IClientStore.ReadUnsentMessages();
        
        // List<String> messagesToSend = GetMessagesToSend(int batchSize, priorityFunction);
        
        // if (isEncryptionRequired)
        {
            // encrypt messages
            
        }
        // IMessage message = ICompressor.compressMessages(messagesToSend);

        // IMessageSender.Send(message);
        
    }
    
    private void ProcessReadCommandV2(
            int userID)
    {    
        // first check in current client store, find all messages
        
    }
}
